import request from '@/utils/request'

// GET /admin/acl/index/info
// info

// POST /admin/acl/index/login
// login

// POST /admin/acl/index/logout
// logout
export interface userinfoModel {
    avatar: string,
    name: string,
    buttons: string[],
    roles: string[],
    routes: string[]
  }

interface tokenModel{
    token:string
}

interface loginModel {
    username: string,
    password: string
}


export default {
    login (data: loginModel){
        return request.post<any,tokenModel>(`/admin/acl/index/login`, data)
    },
    info(){
        return request.get<any,userinfoModel>(`/admin/acl/index/info`)
    },
    logout(){
        return request.post<any,null>(`/admin/acl/index/logout`)
    }
}